-
-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Demonstrate expected behaviour for QueryBuilder::setLocale #607
base: 2.x
Are you sure you want to change the base?
Conversation
I will try and have a look at this tomorrow. This is surely meant to work but couldn't find any existing tests, very odd. |
Maybe adding a doLoadTranslation here would be a way to do it: |
or temporarily setting the locale on the locale chooser right before
executing the query, then restoring the previous once the query is executed.
|
It seems that it would be ideal to add a But by this logic we should add the Another option would be to add translation aware methods, e.g. But I vote for @dbu s suggestion for now.. and we could create an issue to solve this in 2.0 |
the only other option i see would be to remove the possiblility to specify the locale in the query builder. that would be more consistent with the rest. then we would say whatever you do, you need yourself to set the default locale if you want to change something about what the default locale is. i think we can say that changing the default locale for a single call is out of scope of phpcr-odm, and you just need to change the default if you need this. or we could offer some sort of wrapper-system where you can say $dm->defaultLocale('de')->find... defaultLocale() would return a dm decorator that changes the locale on the fly and changes it back. |
Opened issue #623 to discuss how to handle this |
Failing test for issue #605
I would expect setLocale on the QueryBuilder would return the found document in the specified locale